-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restrict installed apps upgrade #13086
base: master
Are you sure you want to change the base?
Conversation
if ( preferRepoType && preferRepoName ) { | ||
preferSameRepo(matching, preferRepoType, preferRepoName); | ||
if (multiple) { | ||
return matchingCharts; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this's been removed since it was not being used anymore
|
||
// Filtering matches by verifying if the current version is in the matched chart's available versions, and that the home value matches as well | ||
const thisHome = chart?.metadata?.home; | ||
const bestMatches = matchingCharts.filter((m) => m.versions.some((v) => v.version === this.currentVersion && v.home === thisHome)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nwmac as we discussed, I've updated the filtering logic, and it seems to be working well. The only drawback is that it's a bit expensive since it requires iterating through the versions array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've optimized the iteration through versions a bit
Summary
Fixes #11679 and #11680
Occurred changes and/or fixed issues
upgradeAvailable
to a more meaningful and readable formatcatalog/chart
in the store to let returning multiple matching chartsmatchingChart
now looks into the versions array of a matched chart to make sure it's a right match. Since a version is like a snapshot in time, it'll be safe to check thehome
value against it for an installed appAreas or cases that should be tested
Unit tests are added to cover different cases for the new approach, but manual tests would be great to make sure it's working as expected.
Make sure
cert-manager
1.7.1 is installed by CLI. Then add OCI repo for AppCo. Go to the installed apps page and make sure there's no upgrade available.Areas which could experience regressions
Install an old version of any apps. Go to the Installed apps page, and check the upgrade is available.
Checklist